﻿using DataTurnClient.Enum;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using SqlSugar;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace DataTurnClient.Model
{
    [SugarTable("Setting")]
    public class Setting : INotifyPropertyChanged
    {
        [SugarColumn(IsIdentity = true, IsPrimaryKey = true)]
        public int Id
        {
            get => _Id;
            set
            {
                _Id = value;
                NotifyPropertyChanged();
            }
        }
        private int _Id;


        [SugarColumn(ColumnDataType = "varchar(20)", IsNullable = true)]
        public string SetGroup
        {
            get => _SetGroup;
            set
            {
                _SetGroup = value;
                NotifyPropertyChanged();
            }
        }
        private string _SetGroup;

        [SugarColumn(ColumnDataType = "varchar(20)", IsNullable = true)]
        public string SetName
        {
            get => _SetName;
            set
            {
                _SetName = value;
                NotifyPropertyChanged();
            }
        }
        private string _SetName;

        [SugarColumn(ColumnDataType = "varchar(20)", IsNullable = true)]
        public string SetValue
        {
            get => _SetValue;
            set
            {
                _SetValue = value;
                NotifyPropertyChanged();
            }
        }
        private string _SetValue;

        [SugarColumn(ColumnDataType = "varchar(255)", IsNullable = true)]
        public string SetDetail
        {
            get => _SetDetail;
            set
            {
                _SetDetail = value;
                NotifyPropertyChanged();
            }
        }
        private string _SetDetail;

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); //实现通知刷新
        }
    }
}
